package main

import (
	"net/http"
	"goBasic/ketanx/help"
	"goBasic/ketanx/0605http/util"
	"bytes"
	"net/url"
	"fmt"
)

func main()  {
	loginRequest()
	//registerRequest()

}

func loginRequest()  {
	response, err := http.Get("http://127.0.0.1:3000/login?usernam=zhangsan&password=123456")
	help.CheckError(err)
	util.ShowResponse(response)
}



func registerRequest()  {
	param := url.Values{
		"usernam":{"zhangsan"},
		"password":{"123456"}}

	buffer := bytes.NewBufferString(param.Encode())

	response, err := http.Post("http://127.0.0.1:3000/register",
		"application/x-www-form-urlencoded", buffer)

	help.CheckError(err)

	util.ShowResponse(response)

	fmt.Println("11111111111")
}











